import './assets/main.css'

import {createApp} from 'vue'
import {createPinia} from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import  './router/permission'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import naive from 'naive-ui'
import * as ELIcons from '@element-plus/icons-vue'



const app = createApp(App)
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate)
app.use(router)
app.use(pinia)
app.use(ElementPlus)
app.use(naive)

app.config.globalProperties.$icons = []
for (const [key, component] of Object.entries(ELIcons)) {
    app.config.globalProperties.$icons.push(key)
    app.component(key, component)
}

app.mount('#app')

